﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using Marking.Dashboard.LoginProxies;

namespace Marking.Dashboard.Services.Remotes
{
    public class RemoteLoginService : ILoginService
    {
        public void Login(string password, Action success, Action failure)
        {
            var proxy = new LoginServiceClient();

            proxy.LoginCompleted += (send, e) =>
            {
                if (e.Error == null && e.Result)
                {
                    success();
                }
                else
                {
                    failure();
                }
            };

            proxy.LoginAsync(password);
        }
    }
}
